<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
[#include "/admin/include/head.htm"]

	<script type="text/javascript">
		$(function () {
			//表单底部按钮
			LG.setFormDefaultBtn(false, save, function () {
				$('input').val("");
			});
		});

		function save() {
			var oldPassword = $("#oldPassword").val();
			var password1 = $("#password1").val();
			var password2 = $("#password2").val();

			if (password1 != password2) {
				LG.showError("两次输入的密码不一致");
				return;
			}

			$.ajax({
				url: base + '/admin/adminUser/setPwd.aspx',
				type: "POST",
				data: {oldPassword: oldPassword, password1: password1, password2: password2},
				dataType: "json",
				success: function (result) {
					if (result.type == "success") {
						LG.showSuccess(result.content, function () {
							window.location.href = '${path}/a/login.aspx';
						});
					} else {
						LG.showError(result.content);
					}
				},
				error: function (XMLHttpRequest, status, errorThrown) {
					if (XMLHttpRequest.status == 400) {
						LG.showError(XMLHttpRequest.responseText)
					}
				}
			});
		}

	</script>

</head>
<body style="overflow:hidden;padding:10px;">

<form id="mainform" class="validate">
	<div id="tabcontainer" style="overflow:hidden;margin:3px;">
		<table class="table" style="width:100%;">

			<tr>
				<th>旧密码：</th>
				<td>
					<input type="password" class="formText" id="oldPassword" name="oldPassword">

				</td>
			</tr>
			<tr>
				<th>新密码：</th>
				<td>
					<input type="password" class="formText" id="password1" name="password1">

				</td>
			</tr>

			<tr>
				<th>确认密码：</th>
				<td>
					<input type="password" class="formText" id="password2" name="password2">
				</td>
			</tr>

		</table>
	</div>
</form>

</body>
</html>